static String readFirstLineFromFile(String path) throws IOException {
    // 创建资源并直接在括号内初始化
    try (BufferedReader br = new BufferedReader(new FileReader(path))) {
        return br.readLine();
    }
}